<template>
  <div id="app">
    <home/>
  </div>
</template>

<script>
  import chat from './libs/chat'
  import home from './components/home'

  export default {
    name: 'App',
    components: {
      home
    },
    methods: {
      getUrlParam(key) {
        let reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
        let result = window.location.search.substr(1).match(reg);
        return result ? decodeURIComponent(result[2]) : "";
      }
    },
    created() {
      this.token = this.getUrlParam('token');
      chat.init(this.token);
    }
  }
</script>

<style>
  body{
    margin: 0;
    overflow: hidden;
  }
  #app {
    font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #2c3e50;
    border: .4px solid #eaeaea;
    margin: 0;
  }
</style>
